/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package muddb.entities;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;


/**
 *
 * @author keith
 */
@Embeddable
public class SkillProfPK implements Serializable {
  @Column( name = "user_id", nullable = false )
  private int userId;
  @Column( name = "char_id", nullable = false )
  private int charId;
  @Column( name = "skill_id", nullable = false )
  private int skillId;
  @Column(name = "skill_grp_id", nullable = false)
  private int skillGroupId;


  public SkillProfPK() {
  }


  public SkillProfPK( int userId, int charId, int skillId ) {
    this.userId = userId;
    this.charId = charId;
    this.skillId = skillId;
  }


  public int getUserId() {
    return userId;
  }


  public void setUserId( int userId ) {
    this.userId = userId;
  }


  public int getCharId() {
    return charId;
  }


  public void setCharId( int charId ) {
    this.charId = charId;
  }


  public int getSkillGroupId() {
    return skillGroupId;
  }


  public void setSkillGroupId( int skillGroupId ) {
    this.skillGroupId = skillGroupId;
  }


  public int getSkillId() {
    return skillId;
  }


  public void setSkillId( int skillId ) {
    this.skillId = skillId;
  }


  @Override
  public int hashCode() {
    int hash = 0;
    hash += (int) userId;
    hash += (int) charId;
    hash += (int) skillId;
    hash += (int) skillGroupId;
    return hash;
  }


  @Override
  public boolean equals( Object object ) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if ( !( object instanceof SkillProfPK ) ) {
      return false;
    }
    SkillProfPK other = (SkillProfPK) object;
    if ( this.userId != other.userId ) {
      return false;
    }
    if ( this.charId != other.charId ) {
      return false;
    }
    if ( this.skillId != other.skillId ) {
      return false;
    }
    if ( this.skillGroupId != other.skillGroupId ) {
      return false;
    }
    return true;
  }


  @Override
  public String toString() {
    return "muddb.entities.SkillProf[userId=" + userId + ", charId=" + charId + ", skillGroupId=" + skillGroupId +  ", skillId=" + skillId + "]";
  }

}
